package csc.ex.bs.dto;
// Generated Apr 3, 2014 10:01:27 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

/**
 * Admin generated by hbm2java
 */
@Entity
@Table(name = "admin", catalog = "bookstore")
@DynamicInsert
@DynamicUpdate
@SelectBeforeUpdate
public class Admin implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String name;
	private String username;
	private int salt;
	private String password;
	private Date createdDate;

	public Admin() {
	}

	public Admin(String name, String username, int salt, String password) {
		this.name = name;
		this.username = username;
		this.salt = salt;
		this.password = password;
	}

	public Admin(String name, String username, int salt, String password,
			Date createdDate) {
		this.name = name;
		this.username = username;
		this.salt = salt;
		this.password = password;
		this.createdDate = createdDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "username", nullable = false, length = 20)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "salt", nullable = false)
	public int getSalt() {
		return this.salt;
	}

	public void setSalt(int salt) {
		this.salt = salt;
	}

	@Column(name = "password", nullable = false, length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createdDate", length = 19)
	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

}
